xlv.imp.layout={
	implement:function(){
	},
	method:{
		layout_properties:{
			slideElement:true
		},
		_layout_elements:function(aE,aCLASS_NAME){
			var p=this.layout_properties;
			var es=xlv.util.siblings(aE, {xlvobject:'*'});
			for(var i=0,n=es.length;i<n;++i) if(!Element.hasClassName(es[i],aCLASS_NAME))es[i]=null;
			es=es.compact();
			es.push(aE);
			return es;
		},
		_layout_layoutElements:function(aES,aCLASS_NAME){
			var x=0,y=0;
			var dim=Element.getDimensions(this);
			/*if body no height width*/
			if(dim.width<=0 || dim.height <=0){
				var div=document.createElement('div');
				Element.setStyle(div, {height:'0px',right:'0px',bottom:'0px',position:'absolute'});
				this.appendChild(div);
				Element.getDimensions(div);
				dim.width=div.offsetLeft;
				dim.height=div.offsetTop;
				this.removeChild(div);
			}
			for(var i=0, n=aES.length;i<n;++i){
				y=Math.max(aES[i].offsetHeight, y); 
				if(x+aES[i].offsetWidth > dim.width){x=0;dim.height-=y;}
				var s={left:x,top:dim.height-aES[i].offsetHeight};
				x+=aES[i].offsetWidth;
				if(this.layout_properties.slideElement)	{
					var move={element:aES[i],style:{left:s.left,top:s.top}};
					xlv.util.styleEffect(move);
				}
				else Element.setStyle(aES[i], s);
			}
		},
		layout_layout:function(aE,aCLASS_NAME){
			this._layout_layoutElements(this._layout_elements(aE,aCLASS_NAME),aCLASS_NAME);
		}
	}
};

